//
//  HAViewController.m
//  HIGHT
//
//  Created by 夜空 on 2017/5/9.
//  Copyright © 2017年 夜空. All rights reserved.
//
#import "HanViewController.h"
#import "HAViewController.h"
#import "Masonry/Masonry.h"
#define UISCREEN_HEIGHT ([[UIScreen mainScreen]bounds].size.height)
#define UISCREEN_WIDTH ([[UIScreen mainScreen]bounds].size.width)
@interface HAViewController ()

@end

@implementation HAViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //导航栏不透明
    self.navigationController.navigationBar.translucent = NO;
    //导航栏背景颜色
    self.navigationController.navigationBar.barTintColor=[UIColor colorWithRed:62/255.0 green:173/255.0 blue:176/255.0 alpha:1.0];
    //导航栏tittle字体大小颜色
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:19],NSForegroundColorAttributeName:[UIColor whiteColor]}];
    //开启系统自带侧滑返回
    self.navigationController.interactivePopGestureRecognizer.delegate = (id<UIGestureRecognizerDelegate>)self;
    //修改导航栏左右按钮字体颜色
    self.navigationController.navigationBar.tintColor=[UIColor whiteColor];
    //修改导航栏返回按钮文字
    self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:nil action:nil];

    
   
    
   
    
    self.title=@"测试";
    self.view.backgroundColor=[UIColor whiteColor];
    [self subview];
    // Do any additional setup after loading the view.
}
-(void)subview{

    UIButton * backbtn=[UIButton buttonWithType:UIButtonTypeCustom];
    [backbtn setTitle:@"返回" forState:UIControlStateNormal];
    backbtn.frame=CGRectMake(10, 0, 300, 44);
    [backbtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    backbtn.titleLabel.font=[UIFont systemFontOfSize:15];
    [backbtn addTarget:self action:@selector(backbtn:) forControlEvents:UIControlEventTouchUpInside];
    backbtn.contentHorizontalAlignment=UIControlContentHorizontalAlignmentLeft;
    [self.view addSubview:backbtn];
    
    
    CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];

    
    UIButton * btn=[UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:@"下一页" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    btn.titleLabel.font=[UIFont systemFontOfSize:20];
    btn.backgroundColor=[UIColor greenColor];
    [btn addTarget:self action:@selector(btn:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self.view.mas_bottom);
        make.left.mas_equalTo(0);
        make.width.mas_equalTo(UISCREEN_WIDTH);
        make.height.mas_equalTo(40);
    }];
    
    
    
    int aaa=0;
    
    
    int a=1;
    int b=1;
    if (a==b) {
        NSLog(@"1111111111");
    }
    
    
    
    
    
    

}
-(void)btn:(UIButton *)sender{
    HanViewController * han=[[HanViewController alloc] init];
    [self.navigationController pushViewController:han animated:YES];
    
    
    
}
-(void)backbtn:(UIButton *)sender{
    CATransition *animation = [CATransition animation];
    animation.duration = 0.5;
    animation.timingFunction = UIViewAnimationCurveEaseInOut;
    animation.type = @"cube";
    //animation.type = kCATransitionPush;
    animation.subtype = kCATransitionFromRight;
    [self.view.window.layer addAnimation:animation forKey:nil];
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
